#include <stdio.h>
#include <stdlib.h>
#include <flgrCoreData.h>
#include <flgrCoreDataIO.h>
#include <flgrCoreCopy.h>
#include <flgrCoreShift.h>
#include "../macro.h"


/////////////////////////////////////////////////////////////////////////
// Test Macro for all flgr2d_convolution types
/////////////////////////////////////////////////////////////////////////
#define tst_Shift1d_Right(dtype)					\
									\
  dtype rawsrc1[] = {0, 1, 2, 2, 3, 0, 0, 0, 3, 0};			\
									\
  dtype rawref[]  = {1, 1, 1, 0, 1, 2, 2, 3, 0, 0};			\
									\
									\
  FLGR_Data1D *datsrc1, *datref, *dat;					\
  FLGR_Vector *vec;							\
  FLGR_Ret ret;								\
  dtype v=1;								\
									\
  datsrc1= flgr1d_create_signal(10,1, flgr_get_type_from_string(#dtype)); \
  datref = flgr1d_create_signal(10,1, flgr_get_type_from_string(#dtype)); \
  dat    = flgr1d_create_signal(10,1, flgr_get_type_from_string(#dtype)); \
									\
  vec = flgr_vector_create(dat->spp,dat->type);				\
  flgr_vector_populate_from_scalar(vec,&v);				\
									\
  flgr1d_import_raw_ptr(datsrc1, rawsrc1);				\
  flgr1d_import_raw_ptr(datref, rawref);				\
									\
  ret=flgr1d_shift_right(dat, datsrc1, 3, vec);				\
  check_and_display_data1d(datref, dat, ret);				\
									\
  flgr1d_destroy(datsrc1);						\
  flgr1d_destroy(datref);						\
  flgr1d_destroy(dat);							\
  flgr_vector_destroy(vec);						\
  return 1


int test_Shift1d_Right_fgUINT8(void) {
  tst_Shift1d_Right(fgUINT8);
}
int test_Shift1d_Right_fgUINT16(void) {
  tst_Shift1d_Right(fgUINT16);
}
int test_Shift1d_Right_fgUINT32(void) {
  tst_Shift1d_Right(fgUINT32);
}
int test_Shift1d_Right_fgINT8(void) {
  tst_Shift1d_Right(fgINT8);
}
int test_Shift1d_Right_fgINT16(void) {
  tst_Shift1d_Right(fgINT16);
}
int test_Shift1d_Right_fgINT32(void) {
  tst_Shift1d_Right(fgINT32);
}
int test_Shift1d_Right_fgFLOAT32(void) {
  tst_Shift1d_Right(fgFLOAT32);
}
int test_Shift1d_Right_fgFLOAT64(void) {
  tst_Shift1d_Right(fgFLOAT64);
}
int test_Shift1d_Right_fgBIT(void) {
  tst_Shift1d_Right(fgBIT);
}





/////////////////////////////////////////////////////////////////////////
// Test Macro for all flgr2d_convolution types
/////////////////////////////////////////////////////////////////////////
#define tst_Shift1d_Left(dtype)						\
									\
  dtype rawsrc1[] = {0, 1, 2, 2, 3, 0, 0, 0, 3, 0};			\
									\
  dtype rawref[]  = {2, 3, 0, 0, 0, 3, 0, 0, 0, 0};			\
									\
									\
  FLGR_Data1D *datsrc1, *datref, *dat;					\
  FLGR_Ret ret;								\
  FLGR_Vector *vec;							\
  dtype v=0;								\
									\
  datsrc1= flgr1d_create_signal(10,1, flgr_get_type_from_string(#dtype)); \
  datref = flgr1d_create_signal(10,1, flgr_get_type_from_string(#dtype)); \
  dat    = flgr1d_create_signal(10,1, flgr_get_type_from_string(#dtype)); \
									\
  vec = flgr_vector_create(dat->spp,dat->type);				\
  flgr_vector_populate_from_scalar(vec,&v);				\
									\
  flgr1d_import_raw_ptr(datsrc1, rawsrc1);				\
  flgr1d_import_raw_ptr(datref, rawref);				\
									\
  ret=flgr1d_shift_left(dat, datsrc1, 3, vec);				\
  check_and_display_data1d(datref, dat, ret);				\
									\
  flgr1d_destroy(datsrc1);						\
  flgr1d_destroy(datref);						\
  flgr1d_destroy(dat);							\
									\
  flgr_vector_destroy(vec);						\
  return 1


int test_Shift1d_Left_fgUINT8(void) {
  tst_Shift1d_Left(fgUINT8);
}
int test_Shift1d_Left_fgUINT16(void) {
  tst_Shift1d_Left(fgUINT16);
}
int test_Shift1d_Left_fgUINT32(void) {
  tst_Shift1d_Left(fgUINT32);
}
int test_Shift1d_Left_fgINT8(void) {
  tst_Shift1d_Left(fgINT8);
}
int test_Shift1d_Left_fgINT16(void) {
  tst_Shift1d_Left(fgINT16);
}
int test_Shift1d_Left_fgINT32(void) {
  tst_Shift1d_Left(fgINT32);
}
int test_Shift1d_Left_fgFLOAT32(void) {
  tst_Shift1d_Left(fgFLOAT32);
}
int test_Shift1d_Left_fgFLOAT64(void) {
  tst_Shift1d_Left(fgFLOAT64);
}
int test_Shift1d_Left_fgBIT(void) {
  tst_Shift1d_Left(fgBIT);
}


/////////////////////////////////////////////////////////////////////////
// Test Macro for all flgr2d_convolution types
/////////////////////////////////////////////////////////////////////////
#define tst_Shift1d_1_Right(dtype)					\
									\
  dtype rawsrc1[] = {0, 1, 2, 3, 1, 0, 0, 2, 0, 0,			\
		     0, 1, 0, 2, 3, 0, 0, 2, 3, 0,			\
		     0, 1, 2, 2, 3, 0, 9, 2, 0, 0,			\
		     0, 1, 2, 0, 3, 1, 0, 2, 0, 0,			\
		     0, 1, 2, 2, 3, 0, 0, 2, 3, 0,			\
		     0, 1, 2, 1, 1, 0, 5, 2, 3, 0,			\
		     0, 1, 0, 2, 0, 2, 0, 2, 0, 0,			\
		     0, 1, 2, 2, 3, 0, 3, 2, 3, 0};			\
									\
  dtype rawref[]  = {1, 0, 1, 2, 3, 1, 0, 0, 2, 0,			\
		     0, 0, 1, 0, 2, 3, 0, 0, 2, 3,			\
		     0, 0, 1, 2, 2, 3, 0, 9, 2, 0,			\
		     0, 0, 1, 2, 0, 3, 1, 0, 2, 0,			\
		     0, 0, 1, 2, 2, 3, 0, 0, 2, 3,			\
		     0, 0, 1, 2, 1, 1, 0, 5, 2, 3,			\
		     0, 0, 1, 0, 2, 0, 2, 0, 2, 0,			\
		     0, 0, 1, 2, 2, 3, 0, 3, 2, 3};			\
									\
									\
									\
  FLGR_Data1D *datsrc1, *datref, *dat;					\
  FLGR_Vector *vec;							\
  FLGR_Ret ret;								\
  dtype v=1;								\
									\
  datsrc1= flgr1d_create_signal(80,1, flgr_get_type_from_string(#dtype)); \
  datref = flgr1d_create_signal(80,1, flgr_get_type_from_string(#dtype)); \
  dat    = flgr1d_create_signal(80,1, flgr_get_type_from_string(#dtype)); \
									\
  vec = flgr_vector_create(dat->spp,dat->type);				\
  flgr_vector_populate_from_scalar(vec,&v);				\
									\
  flgr1d_import_raw_ptr(datsrc1, rawsrc1);				\
  flgr1d_import_raw_ptr(datref, rawref);				\
									\
  ret=flgr1d_shift_right(dat, datsrc1, 1, vec);				\
  check_and_display_data1d(datref, dat, ret);				\
									\
  flgr1d_destroy(datsrc1);						\
  flgr1d_destroy(datref);						\
  flgr1d_destroy(dat);							\
  flgr_vector_destroy(vec);						\
  return 1


int test_Shift1d_1_Right_fgUINT8(void) {
  tst_Shift1d_1_Right(fgUINT8);
}
int test_Shift1d_1_Right_fgUINT16(void) {
  tst_Shift1d_1_Right(fgUINT16);
}
int test_Shift1d_1_Right_fgUINT32(void) {
  tst_Shift1d_1_Right(fgUINT32);
}
int test_Shift1d_1_Right_fgINT8(void) {
  tst_Shift1d_1_Right(fgINT8);
}
int test_Shift1d_1_Right_fgINT16(void) {
  tst_Shift1d_1_Right(fgINT16);
}
int test_Shift1d_1_Right_fgINT32(void) {
  tst_Shift1d_1_Right(fgINT32);
}
int test_Shift1d_1_Right_fgFLOAT32(void) {
  tst_Shift1d_1_Right(fgFLOAT32);
}
int test_Shift1d_1_Right_fgFLOAT64(void) {
  tst_Shift1d_1_Right(fgFLOAT64);
}
int test_Shift1d_1_Right_fgBIT(void) {
  tst_Shift1d_1_Right(fgBIT);
}


/////////////////////////////////////////////////////////////////////////
// Test Macro for all flgr2d_convolution types
/////////////////////////////////////////////////////////////////////////
#define tst_Shift1d_1_Left(dtype)					\
									\
  dtype rawsrc1[] = {0, 1, 2, 3, 1, 0, 0, 2, 0, 0,			\
		     0, 1, 0, 2, 3, 0, 0, 2, 3, 0,			\
		     0, 1, 2, 2, 3, 0, 9, 2, 0, 0,			\
		     0, 1, 2, 0, 3, 1, 0, 2, 0, 0,			\
		     0, 1, 2, 2, 3, 0, 0, 2, 3, 0,			\
		     0, 1, 2, 1, 1, 0, 5, 2, 3, 0,			\
		     0, 1, 0, 2, 0, 2, 0, 2, 0, 0,			\
		     0, 1, 2, 2, 3, 0, 3, 2, 3, 0};			\
									\
  dtype rawref[]  = {1, 2, 3, 1, 0, 0, 2, 0, 0, 0, 			\
		     1, 0, 2, 3, 0, 0, 2, 3, 0, 0, 			\
		     1, 2, 2, 3, 0, 9, 2, 0, 0, 0, 			\
		     1, 2, 0, 3, 1, 0, 2, 0, 0, 0, 			\
		     1, 2, 2, 3, 0, 0, 2, 3, 0, 0, 			\
		     1, 2, 1, 1, 0, 5, 2, 3, 0, 0, 			\
		     1, 0, 2, 0, 2, 0, 2, 0, 0, 0, 			\
		     1, 2, 2, 3, 0, 3, 2, 3, 0, 1};			\
									\
									\
									\
  FLGR_Data1D *datsrc1, *datref, *dat;					\
  FLGR_Vector *vec;							\
  FLGR_Ret ret;								\
  dtype v=1;								\
									\
  datsrc1= flgr1d_create_signal(80,1, flgr_get_type_from_string(#dtype)); \
  datref = flgr1d_create_signal(80,1, flgr_get_type_from_string(#dtype)); \
  dat    = flgr1d_create_signal(80,1, flgr_get_type_from_string(#dtype)); \
									\
  vec = flgr_vector_create(dat->spp,dat->type);				\
  flgr_vector_populate_from_scalar(vec,&v);				\
									\
  flgr1d_import_raw_ptr(datsrc1, rawsrc1);				\
  flgr1d_import_raw_ptr(datref, rawref);				\
									\
  ret=flgr1d_shift_left(dat, datsrc1, 1, vec);				\
  check_and_display_data1d(datref, dat, ret);				\
									\
  flgr1d_destroy(datsrc1);						\
  flgr1d_destroy(datref);						\
  flgr1d_destroy(dat);							\
  flgr_vector_destroy(vec);						\
  return 1


int test_Shift1d_1_Left_fgUINT8(void) {
  tst_Shift1d_1_Left(fgUINT8);
}
int test_Shift1d_1_Left_fgUINT16(void) {
  tst_Shift1d_1_Left(fgUINT16);
}
int test_Shift1d_1_Left_fgUINT32(void) {
  tst_Shift1d_1_Left(fgUINT32);
}
int test_Shift1d_1_Left_fgINT8(void) {
  tst_Shift1d_1_Left(fgINT8);
}
int test_Shift1d_1_Left_fgINT16(void) {
  tst_Shift1d_1_Left(fgINT16);
}
int test_Shift1d_1_Left_fgINT32(void) {
  tst_Shift1d_1_Left(fgINT32);
}
int test_Shift1d_1_Left_fgFLOAT32(void) {
  tst_Shift1d_1_Left(fgFLOAT32);
}
int test_Shift1d_1_Left_fgFLOAT64(void) {
  tst_Shift1d_1_Left(fgFLOAT64);
}
int test_Shift1d_1_Left_fgBIT(void) {
  tst_Shift1d_1_Left(fgBIT);
}


/////////////////////////////////////////////////////////////////////////
// Test Macro for all flgr2d_convolution types
/////////////////////////////////////////////////////////////////////////
#define tst_Shift1d_spp3_Left(dtype)					\
									\
  dtype rawsrc1[] = {0,0,0,  1,1,1,  2,2,2,  2,2,2,  3,3,3,  0,0,0,  0,0,0,  0,0,0,  3,3,3,  0,0,0}; \
									\
  dtype rawref[]  = {2,2,2,  3,3,3,  0,0,0,  0,0,0,  0,0,0,  3,3,3,  0,0,0,  0,0,0,  0,0,0,  0,0,0}; \
									\
									\
  FLGR_Data1D *datsrc1, *datref, *dat;					\
  FLGR_Ret ret;								\
  FLGR_Vector *vec;							\
  dtype v=0;								\
									\
  datsrc1= flgr1d_create_signal(10,3, flgr_get_type_from_string(#dtype)); \
  datref = flgr1d_create_signal(10,3, flgr_get_type_from_string(#dtype)); \
  dat    = flgr1d_create_signal(10,3, flgr_get_type_from_string(#dtype)); \
									\
  vec = flgr_vector_create(dat->spp,dat->type);				\
  flgr_vector_populate_from_scalar(vec,&v);				\
									\
  flgr1d_import_raw_ptr(datsrc1, rawsrc1);				\
  flgr1d_import_raw_ptr(datref, rawref);				\
									\
  ret=flgr1d_shift_left(dat, datsrc1, 3, vec);				\
  check_and_display_data1d(datref, dat, ret);				\
									\
  flgr1d_destroy(datsrc1);						\
  flgr1d_destroy(datref);						\
  flgr1d_destroy(dat);							\
									\
  flgr_vector_destroy(vec);						\
  return 1


int test_Shift1d_spp3_Left_fgUINT8(void) {
  tst_Shift1d_spp3_Left(fgUINT8);
}
int test_Shift1d_spp3_Left_fgUINT16(void) {
  tst_Shift1d_spp3_Left(fgUINT16);
}
int test_Shift1d_spp3_Left_fgUINT32(void) {
  tst_Shift1d_spp3_Left(fgUINT32);
}
int test_Shift1d_spp3_Left_fgINT8(void) {
  tst_Shift1d_spp3_Left(fgINT8);
}
int test_Shift1d_spp3_Left_fgINT16(void) {
  tst_Shift1d_spp3_Left(fgINT16);
}
int test_Shift1d_spp3_Left_fgINT32(void) {
  tst_Shift1d_spp3_Left(fgINT32);
}
int test_Shift1d_spp3_Left_fgFLOAT32(void) {
  tst_Shift1d_spp3_Left(fgFLOAT32);
}
int test_Shift1d_spp3_Left_fgFLOAT64(void) {
  tst_Shift1d_spp3_Left(fgFLOAT64);
}
int test_Shift1d_spp3_Left_fgBIT(void) {
  tst_Shift1d_spp3_Left(fgBIT);
}


/////////////////////////////////////////////////////////////////////////
// Test Macro for all flgr2d_convolution types
/////////////////////////////////////////////////////////////////////////
#define tst_Shift1d_spp3_Right(dtype)					\
									\
  dtype rawsrc1[] = {0,0,0,  1,1,1,  2,2,2,  2,2,2,  3,3,3,  0,0,0,  0,0,0,  0,0,0,  3,3,3,  0,0,0}; \
									\
  dtype rawref[]  = {0,0,0,  0,0,0,  0,0,0,  0,0,0,  1,1,1,  2,2,2,  2,2,2,  3,3,3,  0,0,0,  0,0,0}; \
									\
									\
  FLGR_Data1D *datsrc1, *datref, *dat;					\
  FLGR_Ret ret;								\
  FLGR_Vector *vec;							\
  dtype v=0;								\
									\
  datsrc1= flgr1d_create_signal(10,3, flgr_get_type_from_string(#dtype)); \
  datref = flgr1d_create_signal(10,3, flgr_get_type_from_string(#dtype)); \
  dat    = flgr1d_create_signal(10,3, flgr_get_type_from_string(#dtype)); \
									\
  vec = flgr_vector_create(dat->spp,dat->type);				\
  flgr_vector_populate_from_scalar(vec,&v);				\
									\
  flgr1d_import_raw_ptr(datsrc1, rawsrc1);				\
  flgr1d_import_raw_ptr(datref, rawref);				\
									\
  ret=flgr1d_shift_right(dat, datsrc1, 3, vec);				\
  check_and_display_data1d(datref, dat, ret);				\
									\
  flgr1d_destroy(datsrc1);						\
  flgr1d_destroy(datref);						\
  flgr1d_destroy(dat);							\
									\
  flgr_vector_destroy(vec);						\
  return 1


int test_Shift1d_spp3_Right_fgUINT8(void) {
  tst_Shift1d_spp3_Right(fgUINT8);
}
int test_Shift1d_spp3_Right_fgUINT16(void) {
  tst_Shift1d_spp3_Right(fgUINT16);
}
int test_Shift1d_spp3_Right_fgUINT32(void) {
  tst_Shift1d_spp3_Right(fgUINT32);
}
int test_Shift1d_spp3_Right_fgINT8(void) {
  tst_Shift1d_spp3_Right(fgINT8);
}
int test_Shift1d_spp3_Right_fgINT16(void) {
  tst_Shift1d_spp3_Right(fgINT16);
}
int test_Shift1d_spp3_Right_fgINT32(void) {
  tst_Shift1d_spp3_Right(fgINT32);
}
int test_Shift1d_spp3_Right_fgFLOAT32(void) {
  tst_Shift1d_spp3_Right(fgFLOAT32);
}
int test_Shift1d_spp3_Right_fgFLOAT64(void) {
  tst_Shift1d_spp3_Right(fgFLOAT64);
}
int test_Shift1d_spp3_Right_fgBIT(void) {
  tst_Shift1d_spp3_Right(fgBIT);
}












/////////////////////////////////////////////////////////////////////////
// Test Macro for all flgr2d_convolution types
/////////////////////////////////////////////////////////////////////////
#define tst_Shift_Circular1d_Right(dtype)				\
									\
  dtype rawsrc1[] = {0, 1, 2, 2, 3, 0, 0, 0, 3, 1};			\
									\
  dtype rawref[]  = {0, 3, 1, 0, 1, 2, 2, 3, 0, 0};			\
									\
									\
  FLGR_Data1D *datsrc1, *datref, *dat;					\
  FLGR_Ret ret;								\
									\
  datsrc1= flgr1d_create_signal(10,1, flgr_get_type_from_string(#dtype)); \
  datref = flgr1d_create_signal(10,1, flgr_get_type_from_string(#dtype)); \
  dat    = flgr1d_create_signal(10,1, flgr_get_type_from_string(#dtype)); \
									\
									\
  flgr1d_import_raw_ptr(datsrc1, rawsrc1);				\
  flgr1d_import_raw_ptr(datref, rawref);				\
									\
  ret=flgr1d_shift_circular_right(dat, datsrc1, 3);		\
  check_and_display_data1d(datref, dat, ret);				\
									\
  flgr1d_destroy(datsrc1);						\
  flgr1d_destroy(datref);						\
  flgr1d_destroy(dat);							\
  return 1


int test_Shift_Circular1d_Right_fgUINT8(void) {
  tst_Shift_Circular1d_Right(fgUINT8);
}
int test_Shift_Circular1d_Right_fgUINT16(void) {
  tst_Shift_Circular1d_Right(fgUINT16);
}
int test_Shift_Circular1d_Right_fgUINT32(void) {
  tst_Shift_Circular1d_Right(fgUINT32);
}
int test_Shift_Circular1d_Right_fgINT8(void) {
  tst_Shift_Circular1d_Right(fgINT8);
}
int test_Shift_Circular1d_Right_fgINT16(void) {
  tst_Shift_Circular1d_Right(fgINT16);
}
int test_Shift_Circular1d_Right_fgINT32(void) {
  tst_Shift_Circular1d_Right(fgINT32);
}
int test_Shift_Circular1d_Right_fgFLOAT32(void) {
  tst_Shift_Circular1d_Right(fgFLOAT32);
}
int test_Shift_Circular1d_Right_fgFLOAT64(void) {
  tst_Shift_Circular1d_Right(fgFLOAT64);
}
int test_Shift_Circular1d_Right_fgBIT(void) {
  tst_Shift_Circular1d_Right(fgBIT);
}





/////////////////////////////////////////////////////////////////////////
// Test Macro for all flgr2d_convolution types
/////////////////////////////////////////////////////////////////////////
#define tst_Shift_Circular1d_Left(dtype)				\
									\
  dtype rawsrc1[] = {0, 1, 2, 2, 3, 0, 0, 0, 3, 0};			\
									\
  dtype rawref[]  = {2, 3, 0, 0, 0, 3, 0, 0, 1, 2};			\
									\
									\
  FLGR_Data1D *datsrc1, *datref, *dat;					\
  FLGR_Ret ret;								\
									\
  datsrc1= flgr1d_create_signal(10,1, flgr_get_type_from_string(#dtype)); \
  datref = flgr1d_create_signal(10,1, flgr_get_type_from_string(#dtype)); \
  dat    = flgr1d_create_signal(10,1, flgr_get_type_from_string(#dtype)); \
									\
									\
  flgr1d_import_raw_ptr(datsrc1, rawsrc1);				\
  flgr1d_import_raw_ptr(datref, rawref);				\
									\
  ret=flgr1d_shift_circular_left(dat, datsrc1, 3);			\
  check_and_display_data1d(datref, dat, ret);				\
									\
  flgr1d_destroy(datsrc1);						\
  flgr1d_destroy(datref);						\
  flgr1d_destroy(dat);							\
									\
  return 1


int test_Shift_Circular1d_Left_fgUINT8(void) {
  tst_Shift_Circular1d_Left(fgUINT8);
}
int test_Shift_Circular1d_Left_fgUINT16(void) {
  tst_Shift_Circular1d_Left(fgUINT16);
}
int test_Shift_Circular1d_Left_fgUINT32(void) {
  tst_Shift_Circular1d_Left(fgUINT32);
}
int test_Shift_Circular1d_Left_fgINT8(void) {
  tst_Shift_Circular1d_Left(fgINT8);
}
int test_Shift_Circular1d_Left_fgINT16(void) {
  tst_Shift_Circular1d_Left(fgINT16);
}
int test_Shift_Circular1d_Left_fgINT32(void) {
  tst_Shift_Circular1d_Left(fgINT32);
}
int test_Shift_Circular1d_Left_fgFLOAT32(void) {
  tst_Shift_Circular1d_Left(fgFLOAT32);
}
int test_Shift_Circular1d_Left_fgFLOAT64(void) {
  tst_Shift_Circular1d_Left(fgFLOAT64);
}
int test_Shift_Circular1d_Left_fgBIT(void) {
  tst_Shift_Circular1d_Left(fgBIT);
}




/////////////////////////////////////////////////////////////////////////
// Test Macro for all flgr2d_convolution types
/////////////////////////////////////////////////////////////////////////
#define tst_Shift_Circular1d_spp3_Left(dtype)				\
									\
  dtype rawsrc1[] = {0,0,0,  1,1,1,  2,2,2,  2,2,2,  3,3,3,  0,0,0,  0,0,0,  0,0,0,  3,3,3,  0,0,0}; \
									\
  dtype rawref[]  = {2,2,2,  3,3,3,  0,0,0,  0,0,0,  0,0,0,  3,3,3,  0,0,0,  0,0,0,  1,1,1,  2,2,2}; \
									\
									\
  FLGR_Data1D *datsrc1, *datref, *dat;					\
  FLGR_Ret ret;								\
									\
  datsrc1= flgr1d_create_signal(10,3, flgr_get_type_from_string(#dtype)); \
  datref = flgr1d_create_signal(10,3, flgr_get_type_from_string(#dtype)); \
  dat    = flgr1d_create_signal(10,3, flgr_get_type_from_string(#dtype)); \
									\
									\
  flgr1d_import_raw_ptr(datsrc1, rawsrc1);				\
  flgr1d_import_raw_ptr(datref, rawref);				\
									\
  ret=flgr1d_shift_circular_left(dat, datsrc1, 3);			\
  check_and_display_data1d(datref, dat, ret);				\
									\
  flgr1d_destroy(datsrc1);						\
  flgr1d_destroy(datref);						\
  flgr1d_destroy(dat);							\
									\
  return 1


int test_Shift_Circular1d_spp3_Left_fgUINT8(void) {
  tst_Shift_Circular1d_spp3_Left(fgUINT8);
}
int test_Shift_Circular1d_spp3_Left_fgUINT16(void) {
  tst_Shift_Circular1d_spp3_Left(fgUINT16);
}
int test_Shift_Circular1d_spp3_Left_fgUINT32(void) {
  tst_Shift_Circular1d_spp3_Left(fgUINT32);
}
int test_Shift_Circular1d_spp3_Left_fgINT8(void) {
  tst_Shift_Circular1d_spp3_Left(fgINT8);
}
int test_Shift_Circular1d_spp3_Left_fgINT16(void) {
  tst_Shift_Circular1d_spp3_Left(fgINT16);
}
int test_Shift_Circular1d_spp3_Left_fgINT32(void) {
  tst_Shift_Circular1d_spp3_Left(fgINT32);
}
int test_Shift_Circular1d_spp3_Left_fgFLOAT32(void) {
  tst_Shift_Circular1d_spp3_Left(fgFLOAT32);
}
int test_Shift_Circular1d_spp3_Left_fgFLOAT64(void) {
  tst_Shift_Circular1d_spp3_Left(fgFLOAT64);
}
int test_Shift_Circular1d_spp3_Left_fgBIT(void) {
  tst_Shift_Circular1d_spp3_Left(fgBIT);
}


/////////////////////////////////////////////////////////////////////////
// Test Macro for all flgr2d_convolution types
/////////////////////////////////////////////////////////////////////////
#define tst_Shift_Circular1d_spp3_Right(dtype)				\
									\
  dtype rawsrc1[] = {0,0,0,  1,1,1,  2,2,2,  2,2,2,  3,3,3,  0,0,0,  0,0,0,  0,0,0,  3,3,3,  1,0,0}; \
									\
  dtype rawref[]  = {0,0,0,  3,3,3,  1,0,0,  0,0,0,  1,1,1,  2,2,2,  2,2,2,  3,3,3,  0,0,0,  0,0,0}; \
									\
									\
  FLGR_Data1D *datsrc1, *datref, *dat;					\
  FLGR_Ret ret;								\
									\
  datsrc1= flgr1d_create_signal(10,3, flgr_get_type_from_string(#dtype)); \
  datref = flgr1d_create_signal(10,3, flgr_get_type_from_string(#dtype)); \
  dat    = flgr1d_create_signal(10,3, flgr_get_type_from_string(#dtype)); \
									\
									\
  flgr1d_import_raw_ptr(datsrc1, rawsrc1);				\
  flgr1d_import_raw_ptr(datref, rawref);				\
									\
  ret=flgr1d_shift_circular_right(dat, datsrc1, 3);			\
  check_and_display_data1d(datref, dat, ret);				\
									\
  flgr1d_destroy(datsrc1);						\
  flgr1d_destroy(datref);						\
  flgr1d_destroy(dat);							\
									\
  return 1


int test_Shift_Circular1d_spp3_Right_fgUINT8(void) {
  tst_Shift_Circular1d_spp3_Right(fgUINT8);
}
int test_Shift_Circular1d_spp3_Right_fgUINT16(void) {
  tst_Shift_Circular1d_spp3_Right(fgUINT16);
}
int test_Shift_Circular1d_spp3_Right_fgUINT32(void) {
  tst_Shift_Circular1d_spp3_Right(fgUINT32);
}
int test_Shift_Circular1d_spp3_Right_fgINT8(void) {
  tst_Shift_Circular1d_spp3_Right(fgINT8);
}
int test_Shift_Circular1d_spp3_Right_fgINT16(void) {
  tst_Shift_Circular1d_spp3_Right(fgINT16);
}
int test_Shift_Circular1d_spp3_Right_fgINT32(void) {
  tst_Shift_Circular1d_spp3_Right(fgINT32);
}
int test_Shift_Circular1d_spp3_Right_fgFLOAT32(void) {
  tst_Shift_Circular1d_spp3_Right(fgFLOAT32);
}
int test_Shift_Circular1d_spp3_Right_fgFLOAT64(void) {
  tst_Shift_Circular1d_spp3_Right(fgFLOAT64);
}
int test_Shift_Circular1d_spp3_Right_fgBIT(void) {
  tst_Shift_Circular1d_spp3_Right(fgBIT);
}

